module game {
	export class Test {
		private _view: fairygui.GComponent;

		ldrBg:fairygui.GLoader;

		public constructor(root:egret.DisplayObjectContainer) {
			let pkg = fairygui.UIPackage.addPackage("help");
			this._view =  pkg.createObject('UItest').asCom;
			// this._view = fairygui.UIPackage.createObject("help", "UITest").asCom;
			console.log(this._view);
			
			this._view.setSize(fairygui.GRoot.inst.width, fairygui.GRoot.inst.height);
			fairygui.GRoot.inst.addChild(this._view);
			this.ldrBg = this._view.getChild('ldrBg').asCom.getChild('ldr').asLoader;
			this.ldrBg.url = 'qbsk_gamebg_jpg'

			root.stage.addEventListener(egret.Event.RESIZE, this.onResize, this);
			this.onResize();
		}

		onResize(evt: egret.Event = null): void {
			this._view.setSize(fairygui.GRoot.inst.width, fairygui.GRoot.inst.height);
		}
	}
}